function debt_maturity_overhang_plots(t2m_yrs_single, debt_overhang_single, dmarray, doarray, Nvec, rhovec, isrerun, issmooth)

rf = 0.05;
if isrerun
    [t2m_yrs_single, debt_overhang_single, dmarray, doarray, Nvec, rhovec] = debt_overhang_single_vs_diverse_given_leverage(rf, false, false, false);
end

close all
set(gcf, 'Position', [50 90 2450 900]*0.5)
set(gcf, 'Color', 'w');

linstylestrs = [{'-b'}, {'--r'}, {'-.k'}];
legendstrs = cell(4,1);

Nvec_smooth = linspace(Nvec(1), Nvec(end), 20)';

if issmooth
    Nxaxis = Nvec_smooth;
    dmyaxis_array = interp1(Nvec,dmarray, Nvec_smooth, 'spline');
    doyaxis_array = interp1(Nvec,doarray, Nvec_smooth, 'spline');
else
    Nxaxis = Nvec;
    dmyaxis_array = dmarray;
    doyaxis_array = doarray;
end

tiledlayout(1,2);

nexttile
hold on
for j = 1:length(rhovec)
    plot(Nxaxis, dmyaxis_array(:,j), linstylestrs{j}, 'LineWidth', 1.5)
    legendstrs{j} = ['$\rho = ' num2str(rhovec(j)) '$'];
end
plot(Nvec_smooth, repmat(t2m_yrs_single, length(Nvec_smooth), 1), '-o', 'LineWidth', 1.5, 'MarkerSize', 4, 'MarkerIndices',1:round(length(Nvec_smooth)/5):length(Nvec_smooth))
hold off
legendstrs{4} = 'Debt maturity of stand-alone firm';
legend(legendstrs, 'Location','northoutside', 'Box','off', 'Interpreter','latex', 'NumColumns',4,'FontSize',8);
grid minor
box off
ylim([1.2, 2.2])
xlabel('Number of segments (N)', 'Interpreter','latex')
ylabel('Debt maturity (years)', 'Interpreter','latex')

nexttile
hold on
for j = 1:length(rhovec)
    plot(Nxaxis, doyaxis_array(:,j)*100, linstylestrs{j}, 'LineWidth', 1.5)
end
plot(Nvec_smooth, repmat(debt_overhang_single, length(Nvec_smooth), 1)*100, '-o', 'LineWidth', 1.5, 'MarkerSize', 4, 'MarkerIndices',1:round(length(Nvec_smooth)/5):length(Nvec_smooth))
hold off
legendstrs{4} = 'Debt overhang of stand-alone firm';
legend(legendstrs, 'Location','northoutside', 'Box','off', 'Interpreter','latex', 'NumColumns',4,'FontSize',8);
grid minor
box off
xlabel('Number of segments (N)', 'Interpreter','latex')
ylabel('Debt overhang (percent)', 'Interpreter','latex')